package com.jack.xiaoer.util;

import com.google.common.base.Charsets;
import com.google.common.hash.Hashing;

import java.nio.charset.Charset;

/**
 * Created by Jackaroo Zhang on 2018/12/9.
 */
public class EncryptUtil {

    private static final Charset DEFAULT_CHARSET = Charsets.UTF_8;

    public static String md5(String source) {
        return Hashing.md5().newHasher()
                .putString(source, DEFAULT_CHARSET)
                .hash()
                .toString();
    }

}
